package com.board.tags;

import java.io.IOException;

import javax.servlet.jsp.tagext.SimpleTagSupport;

import org.apache.commons.lang.StringUtils;

public class StringReplace extends SimpleTagSupport {
	private String srcStr;
	private String searchString;
	private String replacement;

	public void doTag() {
		String result = StringUtils.replace(srcStr, searchString, replacement);
		try {
			getJspContext().getOut().println(result);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void setSrcStr(String srcStr) {
		this.srcStr = srcStr;
	}

	public void setSearchString(String searchString) {
		this.searchString = searchString;
	}

	public void setReplacement(String replacement) {
		this.replacement = replacement;
	}

}
